package com.gzhryc.common.config;

public enum EPhoneCode {

    China("+86", "中国+86");

    private String index;
    private String note;

    EPhoneCode(String index, String note) {
        this.index = index;
        this.note = note;
    }

    public String index() {
        return index;
    }

    public String note() {
        I18nTools.I18n i18n = I18nTools.getCurrentI18n();
        if (i18n != null) {
            return i18n.get(this.name(), note);
        }
        return note;
    }

    public static String note(Integer index) {
        EPhoneCode[] temp = EPhoneCode.values();
        for (int i = 0; i < temp.length; i++) {
            EPhoneCode item = temp[i];
            if (item.index.equals(index)) {
                return item.note();
            }
        }
        return null;
    }
}
